<?php
$db['business_orders_objects']=array (
  'columns' => 
  array (
    'obj_id' => 
    array (
      'type' => 'number',
      'required' => true,
      'pkey' => true,
      'extra' => 'auto_increment',
      'editable' => false,
      'comment' => app::get('b2c')->_('供应商订单商品对象ID'),
    ),
	'childOrder_id'=>
        array (
            'type' => 'table:business_orders',
            'required' => true,
            'label' => app::get('b2c')->_('供应商订单号'),
            'width' => 150,
            'comment' => app::get('b2c')->_('子单订单号'),
        ),
    'mainOrder_id'=>
        array (
            'type' => 'varchar(32)',
            'required' => true,
            'label' => app::get('b2c')->_('订单号'),
            'width' => 150,
            'comment' => app::get('b2c')->_('主单订单号'),
			'filtertype' => 'yes',
			'filterdefault' => true,
			'in_list' => true,
			'default_in_list' => true,
        ),
    'business_id'=>
		array(
		'type' => 'table:business_basicmsg',
		'label' => app::get('b2c')->_('供应商名称'),
		'width' => 150,
		'comment' => app::get('b2c')->_('供应商id'),
		'filtertype' => 'yes',
		'filterdefault' => true,
		'in_list' => true,
		'default_in_list' => true,
		),
    'goods_id' => 
    array (
      'type' => 'table:goods',
      'required' => true,
      'default' => 0,
      'editable' => false,
      'comment' => app::get('b2c')->_('商品ID'),
    ),
	  'product_id' =>
			  array (
					  'type' => 'table:products',
					  'required' => true,
					  'default' => 0,
					  'editable' => false,
					  'comment' => app::get('b2c')->_('货品id'),
			  ),
//liuyulei 确认后，需要退款金额
	  'order_refund' =>
			  array (
					  'type' => 'money',
					  'default' => '0',
					  'required' => false,
					  'editable' => false,
					  'comment' => app::get('b2c')->_('需要退款金额'),
			  ),

  'bn' =>
    array (
      'type' => 'varchar(40)',
	  'label' => app::get('b2c')->_('货品编号'),
      'editable' => false,
      'is_title' => true,
      'comment' => app::get('b2c')->_('货号'),
		'filtertype' => 'yes',
		'filterdefault' => true,
    ),
    'name' => 
    array (
      'type' => 'varchar(200)',
      'editable' => false,
      'comment' => app::get('b2c')->_('商品对象名字'),
    ),
    'price' => 
    array (
      'type' => 'money',
      'default' => '0',
      'required' => true,
      'editable' => false,
      'comment' => app::get('b2c')->_('商品对象单价'),
    ),
	'buy_price'=> 
    array (
      'type' => 'money',
      'default' => '0',
      'required' => true,
      'editable' => false,
      'comment' => app::get('b2c')->_('商品对象购买单价'),
    ),
    'amount' => 
    array (
      'type' => 'money',
      'default' => '0',
      'required' => true,
      'editable' => false,
      'comment' => app::get('b2c')->_('商品对象总金额'),
    ),
    'quantity' => 
    array (
      'type' => 'float',
      'default' => 1,
      'required' => true,
      'editable' => false,
      'comment' => app::get('b2c')->_('商品对象购买量'),
    ),
    'weight' => 
    array (
      'type' => 'number',
      'editable' => false,
      'comment' => app::get('b2c')->_('总重量'),
    ),
//	'status'=>array(
//		'type' =>'tinybool',
//		'default'=>'N',
//		'comment' => app::get('b2c')->_('库存确认'),
//	),
	'confirm_num'=>
	array (
      'type' => 'int(10)',
      'default' => 0,
      'comment' => app::get('b2c')->_('需确认的库存数量'),
    ),
	'has_confirm_num'=>
	array (
      'type' => 'int(10)',
      'default' => 0,
      'comment' => app::get('b2c')->_('已确认的库存数量'),
    ),
	'image_default_id'=>
	array (
      'type' => 'varchar(32)',
      'label' => app::get('b2c')->_('商品图片'),
      'width' => 75,
      'hidden' => true,
      'editable' => false,
      'in_list' => false,
    ),
	'state' =>
	  array (
		'type' =>
		array (
		0 => app::get('b2c')->_('未确认'),
		1 => app::get('b2c')->_('已确认'),
		),
		'default'=>'0',
		'required' => true,
		'editable' => false,
		'comment' => app::get('b2c')->_('确认状态'),
	),
	  'gc_state' =>
		  array (
			  'type' =>
				  array (
					  0 => app::get('b2c')->_('未确认'),
					  1 => app::get('b2c')->_('已确认'),
				  ),
			  'default'=>'0',
			  'required' => true,
			  'editable' => false,
			  'comment' => app::get('b2c')->_('集货状态'),
		  ),
	'createtime' =>
		array (
		  'type' => 'time',
		  'label' => app::get('b2c')->_('创建时间'),
		  'width' => 110,
		  'editable' => false,
		  'in_list' => true,
		  'default_in_list' => true,
	),
  'confirm_time' =>
	  array (
			  'type' => 'time',
			  'label' => app::get('b2c')->_('库存确认时间'),
			  'width' => 110,
			  'editable' => false,
			  'filtertype' => 'time',
			  'filterdefault' => true,
	  ),
    'gc_confirm_num'=>
	array (
      'type' => 'int(10)',
      'default' => 0,
      'comment' => app::get('b2c')->_('集货员确认库存数量'),
    ),
  ),
  'index' => 
  array (
    'ind_obj_bn' =>
    array (
        'columns' =>array(
            0 => 'bn',
        ),
        'type' => 'hash',
    ),
	  'ind_mainOrder_id' =>
			  array (
					  'columns' =>array(
							  0 => 'mainOrder_id',
					  ),
			  ),
	  'ind_business_id' =>
			  array (
					  'columns' =>array(
							  0 => 'business_id',
					  ),
			  ),
	  'ind_state' =>
			  array (
					  'columns' =>array(
							  0 => 'state',
					  ),
			  ),
	  'ind_gc_state' =>
			  array (
					  'columns' =>array(
							  0 => 'gc_state',
					  ),
			  ),
  ),
  'engine' => 'innodb',
  'version' => '$Rev: 40912 $',
  'comment' => app::get('b2c')->_('供应商订单商品对象表'),
);

